// 药神卡页面相关接口
import request from "../utils/request.js"

export const getMedList=(page)=>{//这里是请求商品数据
    return request.get(`/yd/mall/productSales?pageIndex=${page}&pageSize=10&typeId=HOT_DRUGS_CARD`)
}

export const topNavList=()=>{//这里是请求顶部导航数据
    return request.get(`/yd/product/category/categoryList`)
}
export const bannerList=()=>{//这里是请求banner数据
    return request.get(`/yd/supplier/h5/index/banner/list?typeIds=YSK_AREA_BANNER`)
}
export const categoryList=(categoryId)=>{//这里是请求分类的数据 例如categoryId=10003是儿童药品
    return request.get(`/yd/es/esSearch?categoryId=${categoryId}&salesTotal=Y&pageIndex=1&pageSize=20&useHealthyCard=1`)
}
export const categoryRankList=({categoryId,isAscending})=>{//这里是请求分类的数据 并且有排序方式
    return request.get(`/yd/es/esSearch?categoryId=${categoryId}&isAscending=${isAscending}&pageIndex=1&pageSize=20&useHealthyCard=1`)
}

export const cartAdd=(obj)=>{//向购物车添加商品
    return request.post(`/yd/shopping/cart/add`,obj)
}


